home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / NeoIntroPP3.0 folder / PowerPlant / Laughs / Includes / CPerson.h < prev   
Encoding:
C/C++ Source or Header  |  1994-08-02  |  1.8 KB  |  75 lines  |  [TEXT/MMCC]

  1. /*     Program name: CClasses  (header)
  2.     Author        : Paul Gee
  3.     Version        : 0.1
  4.     Date        : 19th February 1993
  5.     Purpose        : 
  6. */
  7.  
  8. #include CNeoPersistNativeH
  9. #include <string.h>
  10.  
  11. const NeoID kPersonID    = 20;
  12. const NeoID kJokerID     = 21;
  13. const NeoID kClownID    = 22;
  14.  
  15. class CPerson : public CNeoPersistNative
  16. {
  17. public:
  18.                         CPerson(char *aName = "", NeoID aID = 0);
  19.     void                printName(void) const;
  20.     virtual void        skill(void) const = 0;
  21.  
  22.                         /** I/O Methods **/
  23.     virtual void        readObject(CNeoStream *aStream, const NeoTag aTag);
  24.     virtual void        writeObject(CNeoStream *aStream, const NeoTag aTag);
  25.  
  26. protected:
  27.     char                fName[50];
  28. };
  29.  
  30. enum { kPersonFileLength    = kNeoPersistFileLength + 50};
  31.  
  32. class CJoker : public CPerson
  33. {
  34. public:
  35.                         CJoker(char *aName = "", NeoID aID = 0);
  36.  
  37.     static CNeoPersist *New(void);
  38.     virtual NeoID        getClassID(void) const;
  39.     virtual long        getFileLength(void) const;
  40.  
  41.                         /** I/O Methods **/
  42.     virtual void        readObject(CNeoStream *aStream, const NeoTag aTag);
  43.     virtual void        writeObject(CNeoStream *aStream, const NeoTag aTag);
  44.  
  45.     virtual void        skill(void) const;
  46.     void                setJoke(const char *aJoke) {strncpy(fJoke, aJoke, sizeof(fJoke) -1);}
  47.  
  48. protected:
  49.     char                fJoke[100];
  50. };
  51.  
  52. enum { kJokerFileLength    = kPersonFileLength + 100};
  53.  
  54. class CClown : public CPerson
  55. {
  56. public:
  57.                         CClown(char *aName = "", NeoID aID = 0);
  58.  
  59.     static CNeoPersist *New(void);
  60.     virtual NeoID        getClassID(void) const;
  61.     virtual long        getFileLength(void) const;
  62.  
  63.                         /** I/O Methods **/
  64.     virtual void        readObject(CNeoStream *aStream, const NeoTag aTag);
  65.     virtual void        writeObject(CNeoStream *aStream, const NeoTag aTag);
  66.  
  67.     virtual void        skill(void) const;
  68.     void                setPieType(const char *aPieType) {strncpy(fPieType, aPieType, sizeof(fPieType) -1);}
  69.  
  70. protected:
  71.     char                fPieType[80];
  72. };
  73.  
  74. enum { kClownFileLength    = kPersonFileLength + 80};
  75.